var loginModle = function () {

    return {
            kaptcha:function (a) {
                $.ajax({
                    contentType: "application/json;charset=UTF-8",
                    url: "/kaptcha/render",
                    type: "get",
                    success:function (data) {
                        data = $(a).attr("src");
                        $(a).attr("src",data);
                    }
                })
            },
            login:function() {
            var login = {'account':$('#account').val(),'password':$('#password').val()};
                $.ajax({
                    contentType: "application/json;charset=UTF-8",
                    url: "login",
                    type: "post",
                    data: JSON.stringify(login),
                    success:function (data) {
                        if(data.code == 200){

                            window.location.href = "index";
                        }
                    }
                })
        }

    };
}();